
package com.example.wsnapi;

import wsnAPI.connection.Connection;
import wsnAPI.connection.ResponseWSNCallback;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class SetInterval extends Activity implements ResponseWSNCallback{

	EditText setIntervalEdit;
	Button submitInterval;
	Connection con;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_set_interval);
		
		
		submitInterval = (Button) findViewById(R.id.set_interval_submit);
		submitInterval.setOnClickListener(submitIntervalListener);
		setIntervalEdit = (EditText)findViewById(R.id.set_interval_editText);
		
		con = new Connection("192.168.0.104",8910);
	}
	public void responseReceived(String response)
	{
		
	}
	OnClickListener submitIntervalListener = new OnClickListener()
	{
		@Override
		public void onClick(View arg0)
		{
			con.setInterval(SetInterval.this,Integer.parseInt(setIntervalEdit.getText().toString()));
			finish();
		}
	};

}
